#region Imported Namespaces


using System;


#endregion


namespace WtfManager.UIManager
{
  ///<summary>
  /// Marks a class as panel control.
  ///</summary>
  [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
  public class PanelControlAttribute: Attribute
  {
    #region Fields


    private readonly string _name;
    private readonly bool _allowMultiplePanelsOpen;


    #endregion


    #region Constructors/Finalizers


    /// <summary>
    /// Initializes a new instance of the <see cref="PanelControlAttribute"/> class.
    /// </summary>
    public PanelControlAttribute(string name)
      :this(name, false)
    {
    }


    /// <summary>
    /// Initializes a new instance of the <see cref="PanelControlAttribute"/> class.
    /// </summary>
    /// <param name="name">The name of a panel.</param>
    /// <param name="allowMultiplePanelsOpen">if set to <c>true</c> multiple panels can be opened.</param>
    public PanelControlAttribute(string name, bool allowMultiplePanelsOpen)
    {
      _name = name;
      _allowMultiplePanelsOpen = allowMultiplePanelsOpen;
    }


    #endregion


    #region Properties/Indexers


    /// <summary>
    /// Gets a value indicating whether it is allowed to open multiple panels of this type.
    /// </summary>
    /// <value>
    /// 	<c>true</c> if it is allowed to open multiple panels of this type; otherwise, <c>false</c>.
    /// </value>
    public bool AllowMultiplePanelsOpen
    {
      get
      {
        return _allowMultiplePanelsOpen;
      }
    }


    /// <summary>
    /// Gets a panel name.
    /// </summary>
    public string Name
    {
      get
      {
        return _name;
      }
    }


    #endregion
  }
}